function [ d ] = ksTest( nums, cantCells )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here

    aux = hist(nums, cantCells);
    aux = sort(aux/length(nums));
    
    x = zeros(1, cantCells);
    for i=1:cantCells
       x(i) = sum(aux(1:i));
       fprintf(' $%9.3f$ &', x(i));
    end
    fprintf('\\\\\n');
    
    theoreticalX = (1:cantCells) / cantCells;
    for i=1:cantCells
        fprintf(' $%9.3f$ &', theoreticalX(i));
    end
    fprintf('\\\\\n');
    
    dPlusArray = zeros(1, cantCells);
    dMinusArray = zeros(1, cantCells);
    
    for i=1:cantCells
        dPlusArray(i) = theoreticalX(i) - x(i);
        fprintf(' $%9.3f$ &', dPlusArray(i));
    end
    fprintf('\\\\\n');
    
    dMinusArray(1) = x(1);
    fprintf(' $%9.3f$ &', dMinusArray(1));
    for i=2:cantCells
        dMinusArray(i) = x(i) - theoreticalX(i-1);
        fprintf(' $%9.3f$ &', dMinusArray(i));
    end
    fprintf('\\\\\n');
    
    d = max(max(dPlusArray), max(dMinusArray));
end